package org.lvgo.jx3.common;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.ToString;

/**
 * 请求结果封装
 *
 * @author lvgorice@gmail.com
 * @version 1.0
 * @date 2020/6/18 17:25
 */
@Data
@ToString
public class LvgoResult {

    private int code;
    private Object data;

    public static LvgoResult result(Object o) {
        LvgoResult lvgoResult = new LvgoResult();
        lvgoResult.setCode(200);
        lvgoResult.setData(JSONObject.toJSON(o));
        return lvgoResult;
    }
}
